//#include "SPI.h"
#include "device.h"
void initSPI()
{
	SPIS_1_Init();
	SPIS_1_Enable();
	SPIS_1_EnableRxInt();
	
}
//det antages at inputs ikke overskrider 12 bit.
int SPI_send(int temperature, int batteriSpaending, int ladestroem)
{
	//først sendes temperaturen
	SPIS_1_WriteTxData(temperature);
	//derefter sendes batterispaending
	SPIS_1_WriteTxData(batteriSpaending);
	//Sender ladestroem
	SPIS_1_WriteTxData(ladestroem);
	return 0;
}